<?php 
ob_start();
include_once('connection/connection.php');
include('header.php');
include('menu.php');
include('config.php');
$frm=$_SESSION['form_id'];
$district=$_SESSION['district'];
  
?>
<html xmlns="http://www.w3.org/1999/xhtml">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<title>View Q1</title>
<head>
<script language="javascript" type="text/javascript" >
function PrintContent()
{
var DocumentContainer = document.getElementById('habit');
var WindowObject = window.open("PrintWindow",width=750,height=650,top=50,left=50,toolbars='no',scrollbars='yes',status='no',resizable='yes');
WindowObject.document.writeln(DocumentContainer.innerHTML);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
}
</script>
</head>
<body>
<div id="habit">
<div align="center">
<form action="" method="post" enctype="multipart/form-data">
	<table border="0" width="1231" id="table1" cellspacing="1" cellpadding="1">
		<tr>
			<td width="1139" height="30">
			<p align="center">
			<font face="Verdana" style="font-size: 10pt; font-weight: 700" color="#990000"> 
		  Water Quality Parameter</font></td>
		</tr>
		
	<tr>
		<td>
			<table border="1" width="1228" id="table4" cellspacing="1" cellpadding="1" bgcolor="#FDF9EE" style="border-collapse:collapse; border-color:#99CCCC;">
				
				<tr>
					<td width="2%" height="36" rowspan="2" align="center" bgcolor="#F7E6B7">
						<font face="Verdana" style="font-size: 8.5pt" color="#990000">SI No. </font></td>
					<td width="6%" rowspan="2" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						Date</font></td>
					<td width="6%" height="36" rowspan="2" align="center" bgcolor="#F7E6B7">
						<font style="font-size: 8.5pt" face="Verdana" color="#990000">
						Block Name</font></td>
						<td width="7%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt" face="Verdana" color="#990000">Panchayat Name</font></td>
						<td align="center" width="6%" rowspan="2" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Village Name</font></td>
					    <td width="6%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Habitation Name</font></td>
					    <td width="5%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Habitation Type</font></td>
					    <td width="5%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Source Type</font></td>
					    <td width="4%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Location</font></td>
					    <td width="6%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Latitude</font></td>
					    <td width="5%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Longitude</font></td>
					    <td width="5%" rowspan="2" align="center" bgcolor="#F7E6B7"><font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">Functional status</font></td>
				    <td colspan="6" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						Parameter</font></td>
				</tr>
				<tr>
				  <td width="4%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						pH</font></td>
			      <td width="3%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						TDS</font></td>
			      <td width="2%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						Cl</font></td>
			      <td width="2%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						F</font></td>
			      <td width="3%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						NO<sub>3</sub></font></td>
			      <td width="23%" align="center" bgcolor="#F7E6B7"><font face="Verdana" style="font-size: 8.5pt" color="#990000">
						Bact</font></td>
			  </tr>	
				<?php 
			    $qry_water_quality="SELECT loc.date,l.block_name,l.panchayat_name,l.village_name,l.habitation_name,detail.type_habit,detail.source_type,detail.location,detail.latitude,detail.longitude,detail.functional_status,detail.para_ph,detail.para_tds,detail.para_cl,detail.para_f,detail.para_no3,detail.bact from tbl_dtls_q3_loc loc,tbl_dtls_q3_water_source_detail detail,tbl_lookup_location l where loc.district_id='$district' and loc.id=detail.loc_id and l.district_id='$district' and l.block_id=loc.block_id and l.panchayat_id=loc.panchayat_id and l.village_id=loc.village_id and l.habitation_name=detail.habitation_name";
				$res_water_quality=mysql_query($qry_water_quality);
				$siNo=1;
				while($row2=mysql_fetch_array($res_water_quality))
				{
				?>
				<tr>
				<td  height="23" align="center"><label id="habit_name"><font face="Verdana" style="font-size: 8.5pt"><?php echo $siNo++;?></font></label></td>
				<td align="center"><label id="status_e_nt"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[date]";?></font></label></td>
				<td height="23" align="center"><label id="habit_code"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[block_name]";?></font></label></td>
			   	<td height="23" align="center"><label id="habit_code"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[panchayat_name]";?></font></label></td>
			   	<td height="23" align="center" ><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[village_name]";?></font></label></td>
				
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[habitation_name]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[type_habit]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[source_type]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[location]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[latitude]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[longitude]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[functional_status]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[para_ph]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[para_tds]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[para_cl]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[para_f]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[para_no3]";?></font></label></td>
				<td align="center"><label id="type_habit"><font face="Verdana" style="font-size: 8.5pt"><?php echo "$row2[bact]";?></font></label></td>
				</tr>
			<?php } ?>
			</table></td>
	</tr>
	<tr><td><a href='' onClick='return PrintContent()'>Print this Report</a></td></tr>
</table>
</form>		
</div>
</div>
</body>
</html>